package com.web.portal.dao;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.springframework.stereotype.Repository;

import com.web.portal.entity.LabPolicy;
@Repository (value="labPolicyDao")
public class LabPolicyDaoImpl extends WebportalBaseDao<LabPolicy> implements LabDao  {
	private static final Logger LOG=Logger.getLogger(LabPolicyDaoImpl.class);

	public List<LabPolicy> listItems(LabPolicy instance) {
		// TODO Auto-generated method stub
		LOG.debug("Persisting the LabPolicy from database............");
		try{
			List<LabPolicy> result=(List<LabPolicy>) getSession().createQuery("from LabPolicy").list();
			if(result.isEmpty()){
				LOG.debug("The LabPolicy is empty in the database");
			}
			return result;
		}catch(HibernateException e){
			LOG.debug("Problem persisting the lab policy...................");
			e.printStackTrace();
		}
		return null;
	}

	@Override
	protected void populateCriteria(
			Map<? extends Enum<?>, Object> searchCriteria, Criteria criteria) {
		// TODO Auto-generated method stub
		
	}

}
